﻿using BlazorWebassemblyApp.DataModel;
using BootstrapBlazor.Components;
using Microsoft.AspNetCore.Components;

namespace BlazorWebassemblyApp.Pages;

public partial class StudentDetail : ComponentBase, IResultDialog
{
    #region MyRegion

    [Parameter]
    public string Id { get; set; }

    #endregion

    #region 组件私有参数

    private Student student { get; set; } = new Student();

    #endregion

    #region 控制显示隐藏的参数

    /// <summary>
    /// 是否显示跟进记录
    /// </summary>
    private bool IsShowFollowUpRecord { get; set; } = false;

    #endregion

    #region 生命周期方法

    /// <summary>
    /// 设置参数时
    /// </summary>
    /// <returns></returns>
    protected override async Task OnParametersSetAsync()
    {
        IsShowFollowUpRecord=true;
        await base.OnParametersSetAsync();
    }

    /// <summary>
    /// OnInitialized 方法
    /// </summary>
    protected override async Task OnInitializedAsync()
    {
        student = Student.ConstructStudentList().FirstOrDefault();
        await base.OnInitializedAsync();
    }

    #endregion


    public async Task OnClose(DialogResult result)
    {
    }
}